package com.example.untils;

import java.io.PrintWriter;
import java.io.StringWriter;

/**
 * 获取异常详细信息
 * 
 * @author lli
 *
 */
public class ExceptionUtil {
    /**
     * 获得异常的详细信息
     * 
     * @param e
     * @return
     */
    public static String getExceptionAllinformation(final Throwable e) {
        StringWriter sw = new StringWriter();
        PrintWriter pw = new PrintWriter(sw, true);
        try {
            e.printStackTrace(pw);
            return sw.toString();
        } finally {
            pw.close();
        }
    }
}
